Terraform Local-Exec Provisioner: Run Local Commands/Scripts During Resource Creation/Destruction

youtube
Terraform Local-Exec Provisioner: Run Local Commands/Scripts During Resource Creation/Destruction Welcome to your essential 2025 guide to the Terraform local-exec provisioner! Do you need to run a command or execute a script on the same machine where you are running terraform apply or terraform destroy, triggered by the creation or destruction of a resource? The local-exec provisioner is designed for precisely this scenario, allowing you to invoke local processes as part of your Terraform workflow. This comprehensive tutorial, useful for any Terraform user regardless of the cloud provider (AWS, Azure, GCP), will provide a clear, step-by-step walkthrough of how to use this provisioner. We will explain its core purpose – executing commands locally, not on the remote resource itself – and demonstrate its syntax (provisioner "local-exec" {}). You will learn about its key arguments: command: The command string to execute on your local machine. This command can use attributes from the resource it's attached to (e.g., passing an IP address to a local script). interpreter: Specifies the interpreter to use for the command (e.g., ["/bin/bash", "-c"] for Bash scripts). working_dir: The directory on your local machine from which to run the command. when: Controls whether the provisioner runs during resource creation (create - the default) or destruction (destroy). We will provide practical examples, demonstrating how local-exec could be used to: Run a local script (./configure-dns.sh) after an aws_instance is created, passing the instance's public IP address as an argument. T
  2025/10/24      youtube

Our Tag

最近投稿されたプログラミング学習動画

How to Create Splash Screen in Flutter Without Using Any Package

flutter

How to Create a Custom Splash Screen in ...

  2025/10/26

【生成AI使い方】提案書の構成案作成があっというま|すぐ使える生成AIテンプレート【活用シーン別プロンプトエンジニアリング12】

「キノクエスト」の登録・詳細はこちらから▶︎ e-ラーニング「キノクエスト」な...

  2025/10/26

How to Customize Flutter Native Splash Screen Easily!

flutter

Are you tired of seeing the default whit...

  2025/10/26

Terraform Workspaces Explained: Manage Dev/Staging/Prod Environments w

Welcome to your essential 2025 guide to ...

  2025/10/25

【生成AI使い方】マニュアル作成を整理しながらサポート|すぐ使える生成AIテンプレート【活用シーン別プロンプトエンジニアリング11】

「キノクエスト」の登録・詳細はこちらから▶︎ e-ラーニング「キノクエスト」な...

  2025/10/25

RStudio on Amazon SageMaker AI | Amazon Web Services

Amazon

Build with fully managed integrated deve...

  2025/10/24

AWS Storage: Accelerate and differentiate generative AI innovation | A

Amazon

Generative AI is transforming how enterp...

  2025/10/24

Amazon EBS: Scale enterprise workloads with enhanced block storage | A

Amazon

Amazon EBS delivers the performance and ...

  2025/10/24

AWS Storage: Accelerate and differentiate generative AI innovation | A

Amazon

Generative AI is transforming how enterp...

  2025/10/24

Amazon EBS: Scale enterprise workloads with enhanced block storage | A

Amazon

Amazon EBS delivers the performance and ...

  2025/10/24

Terraform Local-Exec Provisioner: Run Local Commands/Scripts During Re

Welcome to your essential 2025 guide to ...

  2025/10/24

AWS Backup Multi-party approval for logically air-gapped vaults demo |

Amazon

AWS Backup's Multi-party approval for lo...

  2025/10/24

How to Change App Icon & Name in Flutter

flutter

Want to change your Flutter app’s icon a...

  2025/10/23

Google Pixel 10 | Camera Coach ft Giannis Antetokounmpo

Google

See how Camera Coach on the Google #Pixe...

  2025/10/23

Terraform File Provisioner Explained: How to Upload Files to a Virtual

Welcome to your essential 2025 guide to ...

  2025/10/23

Node.js can do that?

node.js

Node.js is not the Node.js you might kno...

  2025/10/23